home *** CD-ROM | disk | FTP | other *** search
- import java.awt.*;
- import symantec.itools.awt.util.dialog.ModalDialog;
-
- public class PasswordDialog extends ModalDialog {
-
- public PasswordDialog(Frame parent, String title)
- {
- super(parent, title);
-
- //{{INIT_CONTROLS
- setLayout(null);
- // addNotify();
- resize(215, 130);
-
- nameLabel = new Label("Name:");
- nameLabel.reshape(10, 32, 75, 15);
- add(nameLabel);
-
- passwordLabel = new Label("Password:");
- passwordLabel.reshape(10, 60, 75, 15);
- add(passwordLabel);
-
- userTextField = new TextField(1);
- userTextField.reshape(85, 28, 100, 22);
- add(userTextField);
-
- passTextField = new TextField(1);
- passTextField.setEchoCharacter('*');
- passTextField.reshape(85, 57, 100, 22);
- add(passTextField);
-
- okButton = new Button("OK");
- okButton.reshape(80, 95, 40, 20);
- add(okButton);
- //}}
- }
-
- public PasswordDialog(Frame parent) {
- this(parent, "Username/Password");
- }
-
- // Add a constructor for Interactions (ignoring modal)
- public PasswordDialog(Frame parent, boolean modal) {
- this(parent);
- }
-
- // Add a constructor for Interactions (ignoring modal)
- public PasswordDialog(Frame parent, String title, boolean modal) {
- this(parent, title);
- }
-
- public String getUserName() {
- return userTextField.getText();
- }
-
- public String getPassword() {
- return passTextField.getText();
- }
-
- public void setUserName(String name) {
- userTextField.setText(name);
- }
-
- public void setPassword(String pass) {
- passTextField.setText(pass);
- }
-
- //{{DECLARE_CONTROLS
- java.awt.Label nameLabel;
- java.awt.Label passwordLabel;
- java.awt.TextField userTextField;
- java.awt.TextField passTextField;
- java.awt.Button okButton;
- //}}
- }
-